Given a screen of a fixed size, creating an image is accomplished by sampling each pixel one or more times in order to determine what can be seen ``through'' that pixel by the camera. A pixel thus covers a square area of the image plane, not just a single point.
If a pixel is not sampled at the proper rate, aliasing will result. Aliasing usually appears as ``jaggies'' or ``stair steps'' in the image. In order to reduce these and other artifacts, <#189#><#2118#>rayshade<#2118#><#189#> provides an adaptive jittered antialiasing scheme that attempts to detect where increased sampling rates are needed. In jittered sampling, the location at which a sample is taken is perturbed by a random amount. This perturbation reduces aliasing but adds noise to the image. Appendix B describes how jittered time sampling is implemented in <#190#><#2120#>rayshade<#2120#><#190#>.
The adaptive sampling scheme implemented in <#191#><#2122#>rayshade<#2122#><#191#> begins
by sampling each pixel on the current scanline once.
For each pixel on the scanline, the contrast between it and its
four immediate neighbors is computed. If this contrast is greater
than a user-specified maximum in any color channel,
the pixel and its
neighbors are all supersampled by firing an additional
<#192#>
A given set of sample values must be filtered in order to assign a color to a pixel. Ideally, when performing filtering for a specific pixel, the filter will consider samples from neighboring regions. In <#205#><#2124#>rayshade<#2124#><#205#>, the filtering applied to a pixel makes use of samples taken for that pixel alone. However, one may increase the size of the filter that is applied in order to approximate the results a more robust filtering scheme.
Jittered sampling is used in <#213#><#2126#>rayshade<#2126#><#213#> to sample extended light sources as well. A total of samples2 samples are taken of each extended light source in order to determine the extent of shadowing.